﻿<ViewDataFormTemplateSpec 
	xmlns="bb_appfx_viewdataformtemplate" 
	xmlns:c="bb_appfx_commontypes" 
	ID="7c12d503-7a16-4757-882a-2d013fc6a3b4" 
	Name="Stewardship Plan Summary View Form Extension"
	Description="Extends the Stewardship Plan Summary View Form"
	Author="Blackbaud Professional Services"
	DataFormInstanceID="3057fafb-6686-433c-beb8-a6d33c1495e3" 
	RecordType="Stewardship Plan"
	c:SecurityUIFolder="TDSM"
	>

  <SPDataForm SPName="USR_USP_DATAFORMTEMPLATE_VIEW_STEWARDSHIPPLANSUMMARY_EXTENSION">
		<c:CreateProcedureSQL>
			<![CDATA[
create procedure dbo.USR_USP_DATAFORMTEMPLATE_VIEW_STEWARDSHIPPLANSUMMARY_EXTENSION
(
  @ID uniqueidentifier
 ,@DATALOADED bit = 0 output
 ,@DESIGNATIONNAME nvarchar(100) = null output
)
as
  set nocount on;
	set @DATALOADED = 1;
	select
    @DESIGNATIONNAME = DES.NAME
	from
    USR_STEWARDSHIPPLAN STW
    INNER JOIN
    DESIGNATION DES
    ON DES.ID = STW.DESIGNATIONID
	where stw.id = @id;
  
  if (@designationname is null) or (@designationname = '') begin
    set @designationname = 'n/a';
  end;
	
  return 0;
  ]]>
    </c:CreateProcedureSQL>
	</SPDataForm>
	
	<c:FormMetaData FixedDialog="true">
		<c:FormFields>
			<c:FormField FieldID="DESIGNATIONNAME" Caption="Designation" DataType="String" MaxLength="100" />
		</c:FormFields>
	</c:FormMetaData>

  <c:DataFormExtension DataFormInstanceID="60ba49e1-e8dd-4c30-b28c-e6e7534d3649" RenderStyle="AfterParent" TabCaption="Designation"/>
</ViewDataFormTemplateSpec>